﻿#region Librerias

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.IO;
using System.Net;
using ESF.General;
using Microsoft.Ajax.Utilities;

#endregion


namespace ESF.Web.Handlers
{
	public class NoCacheFiles : IHttpHandler
	{
		#region Metodos de IHttpHandler

		public bool IsReusable
		{
			get { return false; }
		}

		public void ProcessRequest(HttpContext pContext)
		{
			string fileName;
			string eTag;

			FileInfo fileInfo;

			
			fileName = pContext.Request.PhysicalPath;



			if (ModuleHandlerHelper.GeneratedResponse_SetETagCacheIs304File(pContext, fileName, null, 0, out fileInfo, out eTag))
			{
				return;
			}

			ModuleHandlerHelper.AddESFDescriptionHeader(pContext, "NoCached");

			ModuleHandlerHelper.AddZipFilter(pContext);

			pContext.Response.BinaryWrite (File.ReadAllBytes (fileName));
		}

		#endregion
	}
}
